package org.pi.common.text

object TextTool {
	def loadTextFromFile(filename: String) : String = {
		scala.io.Source.fromFile(new java.io.File(filename)).getLines().foldLeft(""){_+_+"\n"}
	}
	def saveTextToFile(filename: String, text: String): Unit = {
		val fw = new java.io.FileWriter(filename)
		try{ 
			fw.write(text) 
		}
		finally{
			fw.close 
		}
	}
}
